Backport r108702 from trunk
authorChong Yidong <cyd@gnu.org>
Tue, 7 Aug 2012 03:24:35 +0000 (11:24 +0800)
committerChong Yidong <cyd@gnu.org>
Tue, 7 Aug 2012 03:24:35 +0000 (11:24 +0800)
lisp/ChangeLog
lisp/mouse.el

index 6a1098e75dc93415c4b12e4dc5ab4f91bc47990b..7ed254e93ecfd2407fc66e89406c9d123d60d69e 100644 (file)
@@ -1,3 +1,7 @@
+2012-08-07  Chong Yidong  <cyd@gnu.org>
+
+       * mouse.el (mouse-drag-track): Deactivate the mark before popping.
+
 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/cperl-mode.el (cperl-mode): Yet another fix for
index d9511c722ca1631250bec0782203c71dbbbad44a..53238f0352494e86548a8fac69edc1e84dd80a75 100644 (file)
@@ -885,10 +885,15 @@ DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
                     (copy-region-as-kill (mark) (point)))))
 
          ;; Otherwise, run binding of terminating up-event.
-         (cond
-          (do-multi-click (goto-char start-point))
-          (moved-off-start (deactivate-mark))
-          (t (pop-mark)))
+         (setq foo (list (window-buffer (selected-window))
+                         (current-buffer)))
+
+         (if do-multi-click
+             (goto-char start-point)
+           (deactivate-mark)
+           (unless moved-off-start
+             (pop-mark)))
+
          (when (and (functionp fun)
                     (= start-hscroll (window-hscroll start-window))
                     ;; Don't run the up-event handler if the window